Upgrade all default processing models to current versions#75
Upgrade all default processing models to current versions#75jeffgreendesign merged 3 commits intomainfrom
Conversation
- claude-haiku-4-5-20250501 → claude-haiku-4-5-20251001 (Oct 2025) - claude-sonnet-4-6-20250514 → claude-sonnet-4-6 (Feb 2026) - whisper-1 → gpt-4o-mini-transcribe - text-embedding-004 (768d, shut down Jan 14 2026) → gemini-embedding-2-preview (3072d) SQL schemas for Google AI provider updated to 3072-dimension vectors across setup-db-google.sql, setup-db-insights-google.sql, and setup-db-conversation-google.sql. https://claude.ai/code/session_01H2QAEqGW8uh7GxidzoGdSe
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis pull request updates LLM and embedding model defaults and related schema/types. Google embedding model changes from 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
README.md (1)
398-398:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winInconsistent dimension documented for Google AI.
Line 398 still states "Google AI 768d" but this PR changes Google embeddings to 3072 dimensions with
gemini-embedding-2-preview. This should be updated for consistency.📝 Proposed fix
-> **Note:** Each provider uses different embedding dimensions: OpenAI 1536d, Ollama 1024d (or 768d for v2-moe), Google AI 768d. Use the matching schema: `setup-db.sql` (OpenAI), `setup-db-ollama.sql` (Ollama 1024d), `setup-db-ollama-v2.sql` (Ollama 768d), or `setup-db-google.sql` (Google AI). You cannot mix providers without re-embedding all documents. +> **Note:** Each provider uses different embedding dimensions: OpenAI 1536d, Ollama 1024d (or 768d for v2-moe), Google AI 3072d. Use the matching schema: `setup-db.sql` (OpenAI), `setup-db-ollama.sql` (Ollama 1024d), `setup-db-ollama-v2.sql` (Ollama 768d), or `setup-db-google.sql` (Google AI). You cannot mix providers without re-embedding all documents.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 398, Update the README sentence that lists embedding dimensions so Google AI is shown as 3072d (matching the new gemini-embedding-2-preview model) instead of 768d; also ensure the referenced schema name setup-db-google.sql remains correct or note if a new schema (e.g., setup-db-google-3072.sql) is required so readers know which DB schema to use when using gemini-embedding-2-preview.scripts/setup-db-conversation-google.sql (1)
11-37:⚠️ Potential issue | 🟠 MajorExisting databases upgrading from other embedding providers won't be migrated to 3072d
CREATE TABLE IF NOT EXISTSat lines 11 and 27 only affects fresh installs. If users upgrade from setup-db-conversation-ollama.sql (1024d) or setup-db-conversation.sql (1536d), existingconversation_sessions.summary_embeddingandconversation_turns.embeddingcolumns retain their original dimensions. The TypeScript callers insrc/db/conversation-search.tswill attempt to inject 3072d vectors into mismatched columns, causing runtime errors. Add explicit migration steps to handle provider switches.Suggested migration pattern
CREATE TABLE IF NOT EXISTS conversation_turns ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), session_id UUID NOT NULL REFERENCES conversation_sessions(id) ON DELETE CASCADE, role TEXT NOT NULL CHECK (role IN ('user', 'assistant', 'system')), content TEXT NOT NULL, embedding VECTOR(3072), turn_index INTEGER NOT NULL, token_count INTEGER, metadata JSONB DEFAULT '{}', created_at TIMESTAMPTZ DEFAULT NOW(), UNIQUE (session_id, turn_index) ); + +-- Upgrade existing installs from other embedding providers. +-- Existing vectors must be re-embedded after this change. +ALTER TABLE IF EXISTS conversation_sessions + ALTER COLUMN summary_embedding TYPE VECTOR(3072) + USING NULL; + +ALTER TABLE IF EXISTS conversation_turns + ALTER COLUMN embedding TYPE VECTOR(3072) + USING NULL;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/setup-db-conversation-google.sql` around lines 11 - 37, Existing installs won't have their conversation_sessions.summary_embedding and conversation_turns.embedding columns migrated to VECTOR(3072), so runtime errors occur when TS code in src/db/conversation-search.ts writes 3072d vectors; add an explicit migration in the DB setup that detects and converts older-dimension vector columns (from 1024 or 1536 to 3072) instead of only using CREATE TABLE IF NOT EXISTS in setup-db-conversation-google.sql. Implement the migration by adding steps to the SQL script (or a new migration script) that: check current column dimension for conversation_sessions.summary_embedding and conversation_turns.embedding, create a temporary VECTOR(3072) column, copy existing vectors into it (padding/truncating as needed), drop the old column, and rename the temp column to the original name; apply the same logic when switching from setup-db-conversation-ollama.sql or setup-db-conversation.sql so the DB columns match the 3072d expected by the code.
🧹 Nitpick comments (1)
scripts/setup-db-google.sql (1)
1-4: 🏗️ Heavy liftConsider adding migration guidance for existing Google embedding users.
Users with existing databases using the old
text-embedding-004(768d) embeddings will encounter dimension mismatches after upgrading. The schema change fromvector(768)tovector(3072)requires either:
- Re-running the schema on a fresh database, or
- Dropping and recreating the embedding columns and re-embedding all documents
This is a breaking change for existing Google provider users. Consider documenting the migration path in the PR description or a migration guide.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/setup-db-google.sql` around lines 1 - 4, Update the schema file comments to call out that switching from text-embedding-004 (vector(768)) to gemini-embedding-2-preview (vector(3072)) is a breaking change for existing Google embedding users and provide a short migration guide: describe the two supported paths (create a fresh DB and run scripts/setup-db-google.sql, or for existing DBs drop/recreate the embedding columns and re-run re-embedding for all documents), mention re-running scripts/security-rls.sql after schema changes, and suggest verifying embedding provider and dimension compatibility before applying the schema; reference the provider names and dimension types (text-embedding-004, gemini-embedding-2-preview, vector(768), vector(3072)) and advise documenting this guidance in the PR description as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@README.md`:
- Line 398: Update the README sentence that lists embedding dimensions so Google
AI is shown as 3072d (matching the new gemini-embedding-2-preview model) instead
of 768d; also ensure the referenced schema name setup-db-google.sql remains
correct or note if a new schema (e.g., setup-db-google-3072.sql) is required so
readers know which DB schema to use when using gemini-embedding-2-preview.
In `@scripts/setup-db-conversation-google.sql`:
- Around line 11-37: Existing installs won't have their
conversation_sessions.summary_embedding and conversation_turns.embedding columns
migrated to VECTOR(3072), so runtime errors occur when TS code in
src/db/conversation-search.ts writes 3072d vectors; add an explicit migration in
the DB setup that detects and converts older-dimension vector columns (from 1024
or 1536 to 3072) instead of only using CREATE TABLE IF NOT EXISTS in
setup-db-conversation-google.sql. Implement the migration by adding steps to the
SQL script (or a new migration script) that: check current column dimension for
conversation_sessions.summary_embedding and conversation_turns.embedding, create
a temporary VECTOR(3072) column, copy existing vectors into it
(padding/truncating as needed), drop the old column, and rename the temp column
to the original name; apply the same logic when switching from
setup-db-conversation-ollama.sql or setup-db-conversation.sql so the DB columns
match the 3072d expected by the code.
---
Nitpick comments:
In `@scripts/setup-db-google.sql`:
- Around line 1-4: Update the schema file comments to call out that switching
from text-embedding-004 (vector(768)) to gemini-embedding-2-preview
(vector(3072)) is a breaking change for existing Google embedding users and
provide a short migration guide: describe the two supported paths (create a
fresh DB and run scripts/setup-db-google.sql, or for existing DBs drop/recreate
the embedding columns and re-run re-embedding for all documents), mention
re-running scripts/security-rls.sql after schema changes, and suggest verifying
embedding provider and dimension compatibility before applying the schema;
reference the provider names and dimension types (text-embedding-004,
gemini-embedding-2-preview, vector(768), vector(3072)) and advise documenting
this guidance in the PR description as well.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9e665df9-6c02-4990-82bb-266a86824eb6
📒 Files selected for processing (9)
.env.exampleCLAUDE.mdREADME.mdscripts/setup-db-conversation-google.sqlscripts/setup-db-google.sqlscripts/setup-db-insights-google.sqlsrc/services/audio-processor.tssrc/services/embeddings.tssrc/utils/config.ts
- README.md:398: fix Google AI dimension note (768d → 3072d) - setup-db-google.sql: add breaking-change header explaining the vector space incompatibility between text-embedding-004 and gemini-embedding-2-preview, with Option A (fresh DB) and Option B (existing DB column migration) paths - setup-db-conversation-google.sql: add DO block migration that detects conversation_sessions.summary_embedding and conversation_turns.embedding columns with non-3072 dimensions and drops/recreates them; old embeddings are dropped (not padded/truncated) because the models occupy different vector spaces https://claude.ai/code/session_01H2QAEqGW8uh7GxidzoGdSe
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/setup-db-conversation-google.sql`:
- Around line 150-151: The section header "Search Functions (768 dimensions)" is
stale; update that header to "Search Functions (3072 dimensions)" (or otherwise
reflect VECTOR(3072)) so the comment matches the actual function signatures that
use VECTOR(3072); locate the header string in
scripts/setup-db-conversation-google.sql and change it to the 3072-dimension
wording to avoid migration confusion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cef7f150-2b86-4600-99fa-cf7c0cf5e1d6
📒 Files selected for processing (3)
README.mdscripts/setup-db-conversation-google.sqlscripts/setup-db-google.sql
🚧 Files skipped from review as they are similar to previous changes (1)
- scripts/setup-db-google.sql
Update "Search Functions (768 dimensions)" comment to match the actual VECTOR(3072) function signatures below it. https://claude.ai/code/session_01H2QAEqGW8uh7GxidzoGdSe
SQL schemas for Google AI provider updated to 3072-dimension vectors across
setup-db-google.sql, setup-db-insights-google.sql, and setup-db-conversation-google.sql.
https://claude.ai/code/session_01H2QAEqGW8uh7GxidzoGdSe